<template>
  <div class="container">
    <el-dialog title="预览文章" :visible="isPreviewShow" @close="closePreview">
      <h2>{{ currentArticle.title }}</h2>
      <div style="margin-left: 12px">
        <span>{{ currentArticle.createTime | parseTimeByString }}</span>
        <span style="margin-left: 10px">{{ currentArticle.username }}</span>
        <span style="margin-left: 10px" class="el-icon-view"></span>
        <span style="margin-left: 10px">{{ currentArticle.visits }}</span>
      </div>
      <div class="content" v-html="currentArticle.articleBody"></div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    isPreviewShow: {
      type: Boolean,
      default: false
    },
    currentArticle: {
      type: Object,
      default: () => {}
    }
  },
  methods: {
    closePreview () {
      this.$emit('update:isPreviewShow', false)
    }
  }
}
</script>

<style scoped lang='scss'>
.content{
  background: #f5f5f5;
  padding: 10px;
}</style>
>>>>>>> feature/articles
